package com.example.lhh.user.service.impl;


import com.example.lhh.user.entity.LhhPermission;
import com.example.lhh.user.mapper.LhhPermissionMapper;
import com.example.lhh.user.service.ILhhPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author luoHongHu
 * @since 2025-03-25
 */
@Service
public class LhhPermissionServiceImpl extends ServiceImpl<LhhPermissionMapper, LhhPermission> implements ILhhPermissionService {

    @Resource
    private LhhPermissionMapper permissionMapper;

    /**
     *通过用户账号，获取用户拥有的父级菜单
     * @param userNo
     * @return
     */
    @Override
    public List<LhhPermission> getParentMenuByUserNo(String userNo) {
        return permissionMapper.getParentMenuByUserNo(userNo);
    }

    /**
     * 获取子级菜单
     * @param parentCode
     * @return
     */
    @Override
    public List<LhhPermission> getSubeMnuByParentCode(String parentCode) {
        return permissionMapper.getSubeMnuByParentCode(parentCode);
    }

}
